home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
bitmap
/
colorset.bas
< prev
next >
Wrap
BASIC Source File
|
1995-05-09
|
683b
|
36 lines
'-- sets the fg/bg colors of a control
Sub ColorSet (Ctl As Control)
'-- load the form
Load ColorSetForm
ColorSetForm.FG.BackColor = Ctl.ForeColor
ColorSetForm.BG.BackColor = Ctl.BackColor
ColorSetForm.Show MODAL
Ctl.ForeColor = ColorSetForm.FG.BackColor
Ctl.BackColor = ColorSetForm.BG.BackColor
Unload ColorSetForm
End Sub
Function GetBValue (rgbColor As Long) As Integer
GetBValue = rgbColor And &HFF0000 \ &H10000
End Function
Function GetGValue (rgbColor As Long) As Integer
GetGValue = Int(rgbColor And &HFF00& \ &H100&)
End Function
Function GetRValue (rgbColor As Long) As Integer
GetRValue = rgbColor And &HFF&
End Function